--[[
    显示在玩家座位头像上的文本聊天气泡
]]--

local blaze = require "blaze"
local app = require "app"
local gamelib = require "club.threecard.gamelib"
local UIElement = require "blaze.ui.element"
local chat = gamelib.chat

local M = gamelib.ui.element()

function M:ctor(res)
    assert(res)
    self.res = res
end

function M:show(text)
    self:super("show")
    self:lazy("on_show", text)
end

function M:on_show(text)
    self.text.text = text
    self.animator:Play("Bubble Pop")
end

function M.new_left()
    return M.new("club.threecard.gamelib/ui/chat.b:BubbleText - Left")
end

function M.new_right()
    return M.new("club.threecard.gamelib/ui/chat.b:BubbleText - Right")
end

return M